<form action="index.php?app=weixin&ctl=admin_message_text&act=save" id='addtext-edit-form' method="POST">
  <div class="tableform">
    <div class="division">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tbody>
          <{input type="hidden" name='id' value=$data.id}>
          <tr>
            <th><em class="red">*</em><label for="name"><{t}>消息名称：<{/t}></label></th>
            <td><{input type="text" name="name" value=$data.name  size=28  vtype="required" class="x-input " autocomplete="off"}></td>
          </tr>
          <tr>
            <th>
            <em class="red">*</em><label for="is_check_bind"><{t}>是否需要检查免登绑定：<{/t}></label>
            </th>
            <td>
            <input type="radio" name="is_check_bind" value='true' <{if $data.is_check_bind == 'true'}>checked<{/if}>> <{t}>是<{/t}>
            <input type="radio" name="is_check_bind" value='false'<{if $data.is_check_bind != 'true'}>checked<{/if}>> <{t}>否<{/t}> 
            </td>
          </tr>
          <tr>
            <th>
              <em class="red">*</em><label for="content"><{t}>消息内容：<{/t}></label>
            </th>
            <td>
              <{input type="htmllink"  name='content' value=$data.content}>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="table-action">
    <table width="100%" cellspacing="0" cellpadding="0">
      <tbody>
        <tr>
          <td>
            <{button class="btn-primary" id="addtext-edit-form-submit" type="submit" label=$___weixin="保存"|t:'weixin'}>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</form>
<script>
  (function(){
    var _form = $('addtext-edit-form');
    var btn =$('addtext-edit-form-submit');
    var finder = finderGroup['<{$env.get._finder.finder_id}>'];

    _form.store('target',{
      onSuccess:function(response){
        var hash_res_obj = JSON.decode(response);

        if (hash_res_obj.success != undefined && hash_res_obj.success != "")
    {
      try{
        var _dialogIns = btn.getParent('.dialog').retrieve('instance');
      }catch(e){}

      if(_dialogIns)
    {
      _dialogIns.close();
      window.finderGroup['<{$env.get._finder.finder_id}>'].refresh();
    }
    }

      }
    });
    btn.addEvent('click',function(){
      _form.fireEvent('submit',{stop:$empty});
    });

  })();
</script>
